
<script type="text/javascript">

$(function(){	

	//busca disciplinas do combo
	$("#txtSala").load("actions/ajaxlistarSalasSemFiltroComboAction.php");
	
})

function buscaImagensMestres(sala_id){
	$.ajax({
		type:"POST",
		url:"actions/listaMestresAlunosAction.php",
		data:{tipo:'A',sala_id:sala_id},
		dataType:"json",
		success: function(data, textStatus, request){
			$("#fotos").html(data['imagens']);	
		}	
	});
}

function buscaImagensPessoal(pessoa_id){
	$.ajax({
		type:"POST",
		url:"actions/listaImagensPessoalAction.php",
		data:{pessoa_id:pessoa_id},
		dataType:"json",
		success: function(data, textStatus, request){
			$("#fotoPessoa").html(data['imagem']);	
		}	
	});
}

function abrirMensagens(){
	$('#ler_msg').dialog({show: "blind", hide: "explode", width:437, height:220, resizable:false}); 
}

function listaDados(id){
	$.ajax({
		type:"POST",
		url:"actions/voceAction.php",
		data:{id:id, tipo:'A'},
		dataType:"json",
		success: function(data, textStatus, request){
			$("#txtNome").html(data['nome']);
			$("#txtSobrenome").html(data['sobrenome']);
			$("#txtAniversario").html(data['nascimento']);
			
			if(data['sexo']=="M"){
				$("#txtSexo").html("<img src='images/btnOutros/masculino.png'/>");
			}else{
				$("#txtSexo").html("<img src='images/btnOutros/feminino.png'/>");
			}
			
			$("#txtFacebook").html(data['facebook']);
			$("#txtWebPage").html(data['webpage']);
			$("#txtTwitter").html(data['twitter']);
			$("#txtEmail").html(data['email']);
			$("#txtFacebook").html(data['facebook']);
			$("#txtwebpage").html(data['webpage']);
			$("#txtEsporte").html(data['esporte']);
			
			$("#lkFacebook").attr("href",'http://'+data['facebook']);
			$("#lkTwitter").attr("href",'http://'+data['twitter']);	
			$("#lkEmail").attr("href",'mailto:'+data['email']);
			$("#lksite").attr("href",'http://'+data['webpage']);
			
			if(data['icon']!=""){
				$("#icone").html("<img src='images/IconesTempo/"+data['icon']+".png' title='"+data['temperamento']+"' />");
			}
			
			$("#pessoaId").val(data['id_pessoa']);
			
			//carrega o componente enviar mensagem
			$("#cpEnviaMsg").load("componentes/enviarMensagens.php?id="+data['id_pessoa']);

			//exibe foto pessoal
			buscaImagensPessoal(data['id_pessoa']);
			
			//carrega o componente fala professor
			$("#cpMeuVideo").load("componentes/meuVideo.php?id_pessoa="+data['id_pessoa']);
		}	
	});
}

listaDados();
buscaImagensMestres();

function selectId(id){
	$(".img").css("background","#FFF");
	$("#"+id+"").css("background","#369");
	
	//carrega o componente enviar mensagem
	$("#cpEnviaMsg").load("componentes/enviarMensagens.php?id="+id);
	
	listaDados(id);
}


function abrirMeuVideo(){	
	$('#meu_video').dialog({show: "blind", hide: "explode", width:430, height:380, resizable:false}); 	
}


</script>

<div id="selectCurso">	
    <table width="310" border="0">
      <tr>
        <td><span id="title">Série / Curso</span></td>
        <td>
        <select name="txtSala" id="txtSala" onchange="buscaImagensMestres(this.value);" style="width:160px;">
            <option value="">Escolha sua Turma</option>
        </select>
        </td>
      </tr>
    </table>    
</div>

<br />

<div id="formularios">

<div style="position:absolute;width:100px;height:100px;left:670px;top:80px;" id="icone"></div>

<div style="width:120px;height:430px;margin-right:10px;float:left;margin-top:44px;">
	<fieldset style="height:380px;width:120px;text-align:center;">
		<div style="text-align:center;margin-top:14px;overflow:auto;height:350px;width:114px;" id="fotos"></div>        
	</fieldset>
</div>

<div id="form" style="width:650px;height:430px;float:left;">

<fieldset style="height:400px;width:670px;padding:10px;">
        <legend>
            <img src="../images/topoPaginas/Icon_Alunos_Menu.png"/>
        </legend>
        <div style="position:absolute;top:60px;height:10px;width:650px;color:#000;font-weight:bold;text-align:right;">
        <a href="/?pg=home" title="Sair" style="border:0;">
        	<img src="images/btnOutros/btnSairForms.png"/>
        </a>
        </div>
        <div style="padding-left:100px;padding-top:40px;"> 
        
        <form action="actions/voceAction.php" method="post" id="formVoce" name="formVoce">
        	<table width="533" border="0">
              <tr>
                <td width="177">
                	<span id="title">Série Curso</span>
                    <span id="serieCurso"></span>
                    <input type="hidden" id="pessoaId" name="pessoaId"/>
                </td>
                <td width="21">&nbsp;</td>
                <td width="116">&nbsp;</td>
                <td width="171" rowspan="4" align="center" valign="top">
                
                	<div style="background:url(images/btnOutros/fundoFoto.png);width:83px;height:82px;">
                    	<span id="fotoPessoa"></span>
                    </div>
                    
                 </td>
                <td width="26" rowspan="4" align="center" valign="middle"></td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td>
                  
                  <span id="title">Nome</span>
                  <br />
                  <span id="txtNome"></span>                  
                </td>
                <td>&nbsp;</td>
                <td>
                <span id="title">Sexo</span>
                <br />
                <span id="txtSexo"></span>
                </td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td>
                <span id="title">Sobrenome</span>
                <br />
                <span id="txtSobrenome"></span>
                  </td>
                <td>&nbsp;</td>
                <td colspan="2">
                <span id="title">E-mail</span>
                <br />
                <span id="txtEmail"></span>
                </td>
                <td><a href="#" id="lkEmail" title="E-mail" style="border:0;" target="_blank"><img src="images/btnOutros/btnEmail.png" height="22" width="22"/></a></td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td>
                <span id="title">Aniversário</span>
                <br />
                <span id="txtAniversario"></span>
                </td>
                <td>&nbsp;</td>
                <td colspan="2">
                <span id="title">Webpage</span>
                <br />
                <span id="txtWebpage"></span>
                </td>
                <td><a href="#" id="lksite" title="Home" target="_blank" style="border:0;"><img src="images/btnOutros/btnHome.png" height="22" width="22"/></a></td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td>
                <span id="title">Esporte Favorito</span>
                <br />
                <span id="txtEsporte"></span>
                </td>
                <td>&nbsp;</td>
                <td colspan="2">
                <span id="title">Twitter</span>
                <br />
                <span id="txtTwitter"></span>
                </td>
                <td><a href="#" id="lkTwitter" title="Twitter" target="_blank" style="border:0;"><img src="images/btnOutros/btnTwitter.png" height="22" width="22"/></a></td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td colspan="2">
                <span id="title">Facebook</span>
                <br />
                <span id="txtFacebook"></span>
                </td>
                <td><a href="#" id="lkFacebook" title="Facebook" style="border:0;" target="_blank"><img src="images/btnOutros/btnFacebook.png" height="22" width="22"/></a></td>
              </tr>
            </table>

           </form> 
      </div>
    </fieldset>
</div>
    
    <div style="position:relative;width:800px;height:40px;text-align:center;">
    	<a href="javascript:void(0);" onclick="abrirMensagens();" title="Ler Mensagem" style="border:0;text-decoration:none;">
            <img src="images/btnOutros/btnMsg.png"/>
        </a>
        &nbsp;&nbsp;
        <a href="javascript:void(0);" onclick="abrirMeuVideo();" title="Ver Video" style="border:0;text-decoration:none;">
            <img src="images/btnOutros/bot_MeuVideo.png"/>
        </a>
    </div>

</div>


<!-- -----------Mensagem Componente------------- -->
<div id="cpEnviaMsg" style="display:none;"></div>
<!-- -----------Mensagem Componente------------- -->

<!-- -----------video Componente------------- -->
<div id="cpMeuVideo" style="display:none;"></div>
<!-- -----------video Componente------------- -->